<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://unpkg.com/vue/dist/vue.js"></script>
  <script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>
  <style>
    .active{
      color:red;
    }
  </style>
</head>

<body>
  <div id="app">
    <ul>
    <router-link active-class="active" tag="li" to="/position">职位信息</router-link>
    <router-link active-class="active" tag="li" to="/search">搜索</router-link>
    <router-link active-class="active" tag="li" to="/my">我的</router-link>
  </ul>
    <div>
      <router-view></router-view>
    </div>

  </div>

  <script>


    var routes = [
      {
        path: "/position", component: { template: `<div>职位信息</div>` }
      },
      {
        path: "/search", component: { template: `<div>搜索</div>` }
      },
      {
        path: "/my", component: { template: `<div>我的</div>` }
      }
    ]


    var router = new VueRouter({
      routes
    })


    var vm = new Vue({
      router
    }).$mount('#app')

  </script>

</body>

</html>